/********************************************************************
filename : wolf_iic_AT24C64.h
discript : dreamwolf on board EEPROM(AT24C64) control driver,device 
					 address is:0b1010000x,pin connect as below:
					 IIC_SDA  -> PB7,
					 IIC_CLK  -> PB6,
					 nWC      -> GND,
					 A0,A1,A2 -> GND. 
version  : V0.0
editor   : Icy - dreamwolf
time     : 2014.3.1
statement: This file is modified by dreamwolf under LGPL,you could use 
           it free.We cann't ensure there is no error in this file,and
				   if you detect an error please contact us freely,it is so a-
					 ppreciate for your help to improve our code that could help 
					 more people to use it safty.
contact  : edreamtek@163.com
           www.edreamtek.com
********************************************************************/

#ifndef __WOLF_IIC_AT24C64_H__
#define __WOLF_IIC_AT24C64_H__

#include "main.h"


   

#define sEE_HW_ADDRESS         0xA0   /* E0 = E1 = E2 = 0 */ 
#define sEE_PAGESIZE           32
#define sEE_MAXSIZE				 		 8192		/*   8192*8 bits    */ 


#define countof(a) 			(sizeof(a) / sizeof(*(a)))
#define BUFFER_SIZE1    (countof(Tx1_Buffer)-1)
#define BUFFER_SIZE2    (countof(Tx2_Buffer)-1)
#define  BufferSize 		(countof(Tx_Buffer)-1)

typedef enum {FAILED = 0, PASSED = !FAILED} TestStatus;


void wolf_iic_AT24C64_init(void);

void wolf_iic_AT24C64_write_byte(uint16_t addr,uint8_t dat);

uint8_t wolf_iic_AT24C64_read_byte(uint32_t addr);

uint8_t wolf_iic_AT24C64_write_bytes(uint16_t addr,uint8_t* pdat,uint16_t cnt);

uint8_t wolf_iic_AT24C64_read_bytes(uint16_t addr,uint8_t* pdat,uint16_t cnt);

void wolf_iic_AT24C64_test(void);






#endif

